package com.ruoyi.jxxwx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jxxwx.mapper.JxxPatrolMapper;
import com.ruoyi.jxxwx.domain.JxxPatrol;
import com.ruoyi.jxxwx.service.IJxxPatrolService;

/**
 * 巡查记录Service业务层处理
 * 
 * @author wh
 * @date 2025-04-10
 */
@Service
public class JxxPatrolServiceImpl implements IJxxPatrolService 
{
    @Autowired
    private JxxPatrolMapper jxxPatrolMapper;

    /**
     * 查询巡查记录
     * 
     * @param patrolId 巡查记录主键
     * @return 巡查记录
     */
    @Override
    public JxxPatrol selectJxxPatrolByPatrolId(Long patrolId)
    {
        return jxxPatrolMapper.selectJxxPatrolByPatrolId(patrolId);
    }

    /**
     * 查询巡查记录列表
     * 
     * @param jxxPatrol 巡查记录
     * @return 巡查记录
     */
    @Override
    public List<JxxPatrol> selectJxxPatrolList(JxxPatrol jxxPatrol)
    {
        return jxxPatrolMapper.selectJxxPatrolList(jxxPatrol);
    }

    /**
     * 新增巡查记录
     * 
     * @param jxxPatrol 巡查记录
     * @return 结果
     */
    @Override
    public int insertJxxPatrol(JxxPatrol jxxPatrol)
    {
        jxxPatrol.setCreateTime(DateUtils.getNowDate());
        return jxxPatrolMapper.insertJxxPatrol(jxxPatrol);
    }

    /**
     * 修改巡查记录
     * 
     * @param jxxPatrol 巡查记录
     * @return 结果
     */
    @Override
    public int updateJxxPatrol(JxxPatrol jxxPatrol)
    {
        jxxPatrol.setUpdateTime(DateUtils.getNowDate());
        return jxxPatrolMapper.updateJxxPatrol(jxxPatrol);
    }

    /**
     * 批量删除巡查记录
     * 
     * @param patrolIds 需要删除的巡查记录主键
     * @return 结果
     */
    @Override
    public int deleteJxxPatrolByPatrolIds(Long[] patrolIds)
    {
        return jxxPatrolMapper.deleteJxxPatrolByPatrolIds(patrolIds);
    }

    /**
     * 删除巡查记录信息
     * 
     * @param patrolId 巡查记录主键
     * @return 结果
     */
    @Override
    public int deleteJxxPatrolByPatrolId(Long patrolId)
    {
        return jxxPatrolMapper.deleteJxxPatrolByPatrolId(patrolId);
    }
}
